package com.jketing.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.springframework.format.annotation.DateTimeFormat;

import com.jketing.annotation.FieldMeta;

/**
 * ScopeEntity 范围实体基类
 * 
 * 功能：为实现按范围查询实体
 * 比如发公文：
 * 公开范围;集团范围;单位范围;部门范围;私有范围
 * 
 * @author  李荣华
 * @version v1.0
 * @date    2017-11-07
 * @since   jpa 2.1
 */
@MappedSuperclass
public abstract class ScopeEntity  extends BaseEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = -2471488449572181086L;		
	/**
	 * scope:范围
	 */
	protected String scope;
	/**
	 * createTime:创建时间
	 */
	@FieldMeta(name="Date:createTime",explain="创建时间")
	protected Date createTime;

	/**
	 * 无参构造器
	 */
	public ScopeEntity() {
		super();
		scope = "public";//默认为公开
	}
	
	/**
	 * 	scope:范围
	 * 
	 * 	取值如下：
	 * 	public:公开
	 * 	group:集团
	 * 	unit:单位
	 * 	branch:部门
	 * 	private:私有
	 */
	@Column(name="scope_",nullable = false, length = 8)
	public String getScope() {
		return scope;
	}
	public void setScope(String scope) {
		this.scope = scope;
	}
	
	/**
	 * 创建时间
	 */
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	@Temporal(value = TemporalType.TIMESTAMP)
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
}
